package be.g00glen00b.controller;

import java.util.Date;

import org.dozer.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import be.g00glen00b.domain.User;
import be.g00glen00b.entities.UserEntity;

@Controller
public class MainController {
	
	@Autowired
	private Mapper mapper;

	@RequestMapping(value = "/index.html")
	public String getIndex(ModelMap model) {
		UserEntity entity = new UserEntity("Gates", "Bill", new Date(-447465600000L), true);
		User user = mapper.map(entity, User.class);
		
		model.addAttribute("user", user);
		return "index";
	}
}
